package com.yunti.springboot.controller;

import com.yunti.springboot.service.OptionService;
import com.yunti.springboot.vo.Result;
import com.yunti.springboot.vo.req.GetAllExamSubByClassReq;
import com.yunti.springboot.vo.req.GetCouldOptionListReq;
import com.yunti.springboot.vo.req.SearchStudentReq;
import com.yunti.springboot.vo.req.SelectSubReq;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/option")
public class OptionController {

    @Resource
    private OptionService optionService;

    @PostMapping("/getCouldOptionList")
    public Result getCouldOptionList(@RequestBody GetCouldOptionListReq getAllExamSubByClassReq){
        return optionService.getCouldOptionList(getAllExamSubByClassReq);
    }

    @PostMapping("/selectSub")
    public Result selectSub(@RequestBody SelectSubReq selectSubReq){
        return optionService.selectSub(selectSubReq);
    }

    @PostMapping("/del")
    public Result del(@RequestBody SelectSubReq selectSubReq){
        return optionService.del(selectSubReq);
    }

    @PostMapping("/getAllOptionByClass")
    public Result getAllOptionByClass(@RequestBody SearchStudentReq searchStudentReq){
        return optionService.getAllOptionByClass(searchStudentReq);
    }

}
